package org.tissou.client.Panel_Premier.bilan_tab;

import org.tissou.client.Interface.Base_Panel;
import org.tissou.client.Panel_Premier.bilan_tab.Affichages_De_Bilan.Bilan_General;
import org.tissou.client.Panel_Premier.gestion_tab.Operations_de_gestion.Nouvelle_Categorie;

import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

/**
 * Created by IntelliJ IDEA.
 * User: Claire
 * Date: 27-Apr-2009
 * Time: 22:44:59
 * To change this template use File | Settings | File Templates.
 */
public class TAB_Bilan extends Base_Panel {
  DockPanel principal = new DockPanel();
  final VerticalPanel radiobuttons = new VerticalPanel();
  VerticalPanel bilan = new VerticalPanel();
  final RadioButton bilan_general = new RadioButton("Choix", "Bilan general");

  protected void MiseEnPlaceStyles() {
    //To change body of implemented methods use File | Settings | File Templates.
  }

  protected void MiseEnPlaceParametresWidgets() {
    radiobuttons.addStyleName("operationradiobuttons");
    bilan_general.addStyleName("defaultstyle");
  }

  protected void MiseEnPlaceParametresPanel() {
    radiobuttons.add(bilan_general);
  }

  protected void MiseEnPlaceActions() {
       ClickListener afficheLeBonPanel = new ClickListener() {
      public void onClick(Widget sender) {
        bilan.clear();
        RadioButton rb = (RadioButton)sender;
        if ("Bilan general".equals(rb.getText())){
          Bilan_General bm_panel = new Bilan_General();
          bm_panel.afficherDans(bilan);
        }

      }
    };
    bilan_general.addClickListener(afficheLeBonPanel);
  }

  protected void MiseEnPlacePanels() {
    principal.add(radiobuttons, DockPanel.WEST);
    principal.add(bilan, DockPanel.WEST);
    principal.setCellHeight(bilan, "100%");
    principal.setCellWidth(bilan, "100%");
  }

  protected Panel donneLePanelPrincipal() {
    return principal;  
    //To change body of implemented methods use File | Settings | File Templates.
  }
}
